const { DataTypes } = require('sequelize');
const { sequelize } = require('../config/database');

const AiPerson = sequelize.define('AiPerson', {
    id: {
        type: DataTypes.INTEGER,
        primaryKey: true,
        autoIncrement: true,
        allowNull: false
    },
    information: {
        type: DataTypes.JSON,
        allowNull: true
    },
    avatar: {
        type: DataTypes.STRING,
        allowNull: false
    },
    image: {
        type: DataTypes.STRING,
        allowNull: false
    },
    likes: {
        type: DataTypes.STRING,
        allowNull: false
    },
    comments: {
        type: DataTypes.STRING,
        allowNull: false
    },
    is_premium: {
        type: DataTypes.BOOLEAN,
        allowNull: false,
        defaultValue: false
    },
    description: {
        type: DataTypes.TEXT,
        allowNull: false
    },
    images: {
        type: DataTypes.JSON,
        allowNull: false
    },
    videos: {
        type: DataTypes.JSON,
        allowNull: true
    },
    character_profiles: {
        type: DataTypes.JSON,
        allowNull: true
    },
    type: {
        type: DataTypes.STRING,
        allowNull: false
    },
    country: {
        type: DataTypes.STRING,
        allowNull: false,
        defaultValue: 'JP'
    },
    status: {
        type: DataTypes.BOOLEAN,
        allowNull: false,
        defaultValue: true, // 产品上下架状态
        comment: '产品上下架状态'
    }
}, {
    tableName: 'ai_persons',
    timestamps: true
});

module.exports = AiPerson; 